﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SharpBroadcast
{
    public class WebClientValidator : IClientValidator
    {
        public string Validate(string requestPath)
        {
            List<string> paramList = new List<string>();
            string[] parts = requestPath.Split('/');
            foreach (var part in parts)
            {
                if (part.Trim().Length > 0)
                {
                    paramList.Add(part.Trim());
                }
            }
            if (paramList.Count <= 0) return "";

            string sourceName = paramList.First();
            return sourceName;
        }
    }
}
